package com.cs.study.homework._0205;

import java.util.Scanner;

public class Triangle {
    public static void main(String[] args) {
        System.out.println("请输入一个正整数：");
        Scanner sc = new Scanner(System.in);
        //输入要打印的行数
        int line = sc.nextInt();
        //调用print方法打印倒三角
        print(line);
    }

    public static int print(int line) {
        for (int i = 1; i <= line; i++) {
            for (int j = 0; j <= line - i; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
        return line;
    }
}
